package com.yu.crm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yu.crm.domain.pojo.CrmLogin;
import com.yu.crm.domain.pojo.CrmUser;
import com.yxzz.common.BaseResponse;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 用户登录流水表 服务类
 * </p>
 *
 * @author donnie-bin
 * @since 2019-07-31
 */
public interface CrmLoginService extends IService<CrmLogin> {

    /**
     * 注册
     * @param entity
     */
    void registry(CrmLogin entity);

    /**
     * 登录
     * @param entity
     * @return
     */
    CrmUser login(CrmLogin entity);

    /**
     * 退出
     * @param loginToken
     */
    void logout(String loginToken);

    /**
     * 手机号是否已注册
     * @param phone
     */
    BaseResponse<Boolean> isExistPhone(String phone);

    /**
     * 获取图片验证码
     * @param request
     * @param response
     */
    void requestImageCode(HttpServletRequest request, HttpServletResponse response);

    /**
     * 验证code
     * @param verifyId
     * @param code
     * @return
     */
    Boolean verifyImageCode(String verifyId, String code);

    /**
     * 请求短信验证码
     * @param phone
     */
    Boolean requestSmsCode(String phone);

    /**
     * 验证短信验证码
     * @param phone
     * @param code
     * @return
     */
    boolean verifySmsCode(String phone, String code);
}